<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文件服务器</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        h2 {
            padding: 30px;
            font-weight: 500;
        }

        li {
            height: 50px;
            padding-left: 20px;
        }

        ul>li>a {
            line-height: 50px;
            font-size: 30px;
        }

        .icon {
            display: inline-block;
            width: 50px;
            height: 50px;
            background-repeat: no-repeat;
            background-position: center;
            background-size: 35px 35px;
            vertical-align: bottom;
        }

        .icon-dir {
            background-image: url(/img/dir.png);
        }

        .icon-file {
            background-image: url(/img/file.png);
        }

        .dir {
            color: #5555ff;
            text-decoration: underline;
        }

        .file {
            color: #666;
            text-decoration: none;
        }
    </style>
</head>

<body>
    <h2>当前路径: {{title}}</h2>
    <ul>
        {{each results}}
        <li>
            {{if $value.isDir}}
            <span class="icon icon-dir"></span>
            <a class="dir" href="{{$value.pathName.substring(1)}}">{{$value.fileName}}</a>
            {{else}}
            <span class="icon icon-file"></span>
            <a class="file" href="{{$value.pathName.substring(1)}}">{{$value.fileName}}</a>
            {{/if}}
        </li>
        {{/each}}
    </ul>
</body>

</html>